package com.huike.service;

import com.huike.mapper.PatientMapper;
import com.huike.pojo.Bed;
import com.huike.pojo.Patient;
import com.huike.pojo.UpdatePatient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class PatientService {
    @Autowired
    private PatientMapper patientMapper;

    public List<Patient> selectAllPatient(Integer id,String doctorName,String dept) {
        return patientMapper.selectAllPatient(id,doctorName,dept);
    }

    public List<Patient> getPatientDetailById(int id) {
        return patientMapper.getPatientDetailById(id);
    }

    public void addPatient(Patient patient) {
        patientMapper.addPatient(patient);
    }

    public void deleteById(Integer id) {
        patientMapper.deleteById(id);
    }

    public List<Bed> getBedById(int id) {
        return patientMapper.getBedById(id);
    }


    public void beInHospital(int id) {
        patientMapper.beInHospital(id);
    }


    public List<Bed> getAllInHospital(Integer id,String patientName,String dept) {
        return patientMapper.getAllInHospital(id,patientName,dept);
    }

    public void outHospital(int id) {
        patientMapper.outHospital(id);
    }


    public Bed getPatientById(int id) {
        return patientMapper.getPatientById(id);
    }

    public void updatePatient(Patient patient) {
        patientMapper.updatePatient(patient);
    }


    public void updatePatientAndBed(UpdatePatient updatePatient) {
        patientMapper.updatePatientAndBed(updatePatient);
    }
}
